package com.csi.bumblebee.testwdl;


import com.csi.bumblebee.Application;
import com.csi.bumblebee.domain.user.MyCollection;
import com.csi.bumblebee.domain.user.Resume;
import com.csi.bumblebee.domain.vo.MyCollectionVo;
import com.csi.bumblebee.domain.vo.SubmitVo;
import com.csi.bumblebee.service.*;
import com.csi.bumblebee.util.IdUtil;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

@SpringBootTest(classes = Application.class)
@RunWith(SpringRunner.class)
public class testStudent {

    @Autowired
    private StudentService studentService;

    @Autowired
    private ResumeService resumeService;

    @Autowired
    private JobService jobService;

    @Autowired
    private SubmitService submitService;

    @Autowired
    private MyCollectionService myCollectionService;

    @Autowired
    private JobTypeService jobTypeService;

    @Autowired
    private MyLocationService myLocationService;





    @Test
    public void findByIdJob(){
        System.out.println(this.jobService.findByIdJob("UJ2022101818465617171"));
    }

    @Test
    public void likeJob(){
        MyCollection myCollection=new MyCollection();
        myCollection.setId(IdUtil.getString("CT"));
        myCollection.setStudentId("ST2022101010122626315");
        myCollection.setJobId("UJ2022101818465617171");
        System.out.println("收藏岗位："+this.jobService.likeJob(myCollection));
    }

    @Test
    public void findJobIs(){
        MyCollection myCollection=new MyCollection();
        myCollection.setStudentId("ST2022101010122626315");
        myCollection.setJobId("UJ2022101818465617171");
        System.out.println(this.jobService.findLikeJob(myCollection));
    }

    @Test
    public void updateResume(){
        Resume resume=new Resume();
        resume.setName("李思思");
        resume.setStudentId("ST2022101010122626313");
        System.out.println("修改简历信息："+this.resumeService.updateResume(resume));
    }

    @Test
    public void addResume(){
        Resume resume=new Resume();
        resume.setId(IdUtil.getString("US"));
        resume.setStudentId(IdUtil.getString("ST"));
        resume.setGender(2);
        this.resumeService.addResume(resume);
    }

    @Test
    public void findResume(){
        System.out.println("查询简历信息："+this.resumeService.findResume("ST2022101010122626314"));
    }

    @Test
    public void updateResumeStatus(){

        Resume resume=new Resume();
        resume.setStudentId("ST2022101010122626314");
        resume.setStatus(2);

        System.out.println("变更账号的启用："+this.resumeService.updateResumeStatus(resume));
    }

    @Test
    public void listSubmit(){
        for (SubmitVo st2022101010122626313 : this.submitService.listSubmit("ST2022101010122626313")) {
            System.out.println(st2022101010122626313.getHrName());
        }
    }

    @Test
    public void listLikeJob(){
        for (MyCollectionVo myCollectionVo : this.myCollectionService.listLikeJob("ST2022101010122626313")) {

            System.out.println(myCollectionVo.toString());
        }
    }

    @Test
    public void listJobTypeTwo(){

        System.out.println(this.jobTypeService.listJobTypeTwo().toString());

    }

    @Test
    public void listLocationOne(){
        System.out.println(this.myLocationService.listLocationOne());
    }

    @Test
    public void listLocationTwo(){
        System.out.println(this.myLocationService.listLocationTwo());
    }

    @Test
    public void listLocationSon(){
        System.out.println(this.myLocationService.listLocationSon("LC2022101822131210002"));
    }

    @Test
    public void listJobTwos(){
        System.out.println(this.jobService.listJobTwos("JT2022101910488282124"));
    }


    @Test
    public void listJobFather(){
        System.out.println(this.jobTypeService.listJobFather());
    }

    @Test
    public void findByIdJobType(){
        System.out.println(this.studentService.findByIdJobType("ST2022102015032374422"));
    }
}
